<?php
namespace Home\Controller;
use Think\Controller;
class LianjieController extends Controller {
    public function Index(){
        $appname='友情链接';
        $this->assign('appname',$appname);//应用名称
        $lianjie=M('Lianjie');
        $data=$lianjie->where('zt=1')->select();
        $this->assign('lj',$data);
        $this->display();
    }
   /* public function Shenqing(){
        $appname='友情链接申请';
        $this->assign('appname',$appname);//应用名称
        $this->display();
    }*/
    public function doshenqing(){
        if(empty($_POST['mc']) or empty($_POST['wz'])){
            $this->error('关键内容不能为空');
        }
        $lianjie=M('Lianjie');
        $data=array(
            mc => I('post.mc'),
            jc => I('post.jc'),
            wz => I('post.wz'),
            time => time(),
        );
        $do=$lianjie->add($data);
        if($do){
            $this->success('提交成功！');
        }else{
            $this->error('提交失败！');
        }
    }
}